/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */
package view;

import control.AnsatHandler;
import control.FakturaHandler;
import control.FaktureretVareHandler;
import control.KasseHandler;
import control.Main;
import control.TextRegler;
import java.awt.Component;
import java.sql.SQLException;
import java.util.ArrayList;
import javax.swing.DefaultListModel;
import javax.swing.JLabel;
import javax.swing.JTextField;

/**
 *
 * @author Morten J, Morten B & Jonas
 */
public class Kasse extends javax.swing.JPanel {

    private DefaultListModel listModel;
    private FaktureretVareHandler fvh;
    private FakturaHandler fh;
    private boolean firstTime;
    private KasseHandler kh;

    /**
     * Creates new form Kasse
     */
    public Kasse() {

        firstTime = true;
        kh = new KasseHandler();
        fh = new FakturaHandler();
        listModel = new DefaultListModel();
        initComponents();
        jListVare.setModel(listModel);
        fvh = new FaktureretVareHandler(listModel);
        checkKasse();
    }

    public void checkKasse() {
        if (kh.isKasseFound()) {
            jAktuelBeholdning.setVisible(true);
            jStartbeholdning.setVisible(false);
            setStartBeholdning();
        } else {
            jAktuelBeholdning.setVisible(false);
            jStartbeholdning.setVisible(true);
            skrivebeskyttet(true);
        }
        skrivebeskyttetBetal(true);
    }

    public final void skrivebeskyttet(boolean e) {
        ArrayList<Component> com = new ArrayList<>();

        com.add(jBtnAdd);
        com.add(jBtnFjern);
        com.add(jListVare);
        com.add(jPanHolder);
        com.add(jPanFaktura);
        com.add(jPanTilfVarer);
        com.add(jPanTop);
        com.add(jTextAntal);
        com.add(jTextFaktura);
        com.add(jTextVare);
        com.add(jBtnKassen);

        for (Component comp : com) {
            comp.setEnabled(!e);
        }
    }

    public void skrivebeskyttetBetal(boolean e) {
        ArrayList<Component> com = new ArrayList<>();
        com.add(jBtnBetal);
        com.add(jRadioEu);
        com.add(jRadioKr);
        com.add(jCheckMedlem);
        for (Component comp : com) {
            comp.setEnabled(!e);
        }
    }

    public void setIndtastetVare(String nr) {
        jTextVare.setText(nr);
    }

    public void setKasseError(String error) {
        jKasseFeedback.setText(error);
    }

    public void setStartBeholdning() {
        if (!kh.isKasseFound()) {
            skrivebeskyttet(false);
            try {
                double aktuelKr = TextRegler.roundDouble(Double.parseDouble(jSBkr.getText()));
                double aktuelEu = TextRegler.roundDouble(Double.parseDouble(jSBeu.getText()));
                jAktuelKr.setText(String.valueOf(aktuelKr));
                jAktuelEu.setText(String.valueOf(aktuelEu));
                kh.createKasse(aktuelKr, aktuelEu);
            } catch (NumberFormatException ex) {

            }
        } else {
            kh.createKasseObject();
            setAktuelKasse();
        }
        if (kh.getKasse().isKasseOptalt()) {
            jAktuelBeholdning.setVisible(false);
            skrivebeskyttet(true);
            jKasseFeedback.setText("Kassen er lukket for i dag");
        } else {
            jTextVare.setText("");
            jStartbeholdning.setVisible(false);
            jAktuelBeholdning.setVisible(true);
        }
    }

    private void startBeholdningDouble(JTextField text) {
        try {
            TextRegler.onlyDouble(text);
            Double.parseDouble(text.getText());
            text.setBackground(Main.getGREEN_COLOR());
        } catch (NumberFormatException ex) {
            text.setBackground(Main.getRED_COLOR());
        }
    }

    public void focusKasse() {
        if (kh.isKasseFound()) {
            jTextVare.requestFocus();
        } else {
            jSBkr.requestFocus();
        }
    }

    public void addVare() {
        if (jTextVare.getText().equals("999")) {
            addAll();
        }
        if (!jTextVare.getText().isEmpty() && !jTextAntal.getText().isEmpty()) {
            if (jTextVare.getText().length() < 11) {
                try {
                    if (firstTime) {
                        fh.CreateFaktura(Main.getDbConnection().getNextInvoiceNumber(), AnsatHandler.getAktuelAnsat(), FaktureretVareHandler.getFaktureretVareListe());
                        firstTime = false;
                        skrivebeskyttetBetal(false);
                    }
                    try {
                        fvh.checkVare(Integer.parseInt(jTextVare.getText()), Integer.parseInt(jTextAntal.getText()));
                        showInvoice();
                    } catch (NumberFormatException ex) {
                        GUI.getGuiHandler().setFeedbackMessage("Kun tal er tilladt i dette felt", Main.getRED_COLOR());
                    }
                } catch (SQLException ex) {
                    GUI.getGuiHandler().setFeedbackMessage(" ved fakturaoprettelse");
                } catch (NullPointerException ex) {
                    GUI.getGuiHandler().setFeedbackMessage(" ved fakturaoprettelse");
                }

            } else {
                GUI.getGuiHandler().setFeedbackMessage("Varenummer: " + jTextVare.getText() + " findes ikke i varelisten", Main.getRED_COLOR());
            }
        }
    }

    public void setAktuelKasse() {
        jAktuelKr.setText((Math.round(kh.getKasse().getAktuelKr() * 100.0) / 100.0) + "");
        jAktuelEu.setText((Math.round(kh.getKasse().getAktuelEu() * 100.0) / 100.0) + "");
        jRadioKr.setSelected(true);
    }

    public void addAll() {
        jTextVare.setText("1");
        addVare();
        jTextVare.setText("2");
        addVare();
        jTextVare.setText("3");
        addVare();
        jTextVare.setText("4");
        addVare();
        jTextVare.setText("5");
        addVare();
        jTextVare.setText("6");
        addVare();
        jTextVare.setText("7");
        addVare();
        jTextVare.setText("8");
        addVare();
        jTextVare.setText("9");
        addVare();
        jTextVare.setText("10");
        addVare();
        jTextVare.setText("11");
        addVare();
        jTextVare.setText("12");
        addVare();
        jTextVare.setText("13");
        addVare();
        jTextVare.setText("14");
        addVare();
        jTextVare.setText("15");
        addVare();
        jTextVare.setText("16");
        addVare();
        jTextVare.setText("17");
        addVare();
        jTextVare.setText("18");
        addVare();
        jTextVare.setText("19");
        addVare();
        jTextVare.setText("20");
        addVare();
        jTextVare.setText("21");
        addVare();
        jTextVare.setText("22");
        addVare();
        jTextVare.setText("23");
        addVare();
        jTextVare.setText("24");
        addVare();
        jTextVare.setText("25");
        addVare();
        jTextVare.setText("26");
        addVare();
        jTextVare.setText("27");
        addVare();
        jTextVare.setText("28");
        addVare();
        jTextVare.setText("29");
        addVare();
        jTextVare.setText("30");
        addVare();
        jTextVare.setText("31");
        addVare();
        jTextVare.setText("32");
        addVare();
        jTextVare.setText("33");
        addVare();
    }

    public JLabel getLabel() {
        return jKasseFeedback;
    }

    /**
     * This method is called from within the constructor to initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is always
     * regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        buttonGroup = new javax.swing.ButtonGroup();
        jStartbeholdning = new javax.swing.JPanel();
        jSBLAB = new javax.swing.JLabel();
        jSBkr = new javax.swing.JTextField();
        jLabKr = new javax.swing.JLabel();
        jLabeu = new javax.swing.JLabel();
        jSBeu = new javax.swing.JTextField();
        jBtnStartbeholdning = new javax.swing.JButton();
        jAktuelBeholdning = new javax.swing.JPanel();
        jSBLAB1 = new javax.swing.JLabel();
        jKr = new javax.swing.JLabel();
        jEu = new javax.swing.JLabel();
        jLabEu = new javax.swing.JLabel();
        jBtnKassen = new javax.swing.JButton();
        jAktuelEu = new javax.swing.JTextField();
        jLabKr1 = new javax.swing.JLabel();
        jAktuelKr = new javax.swing.JTextField();
        jPanHolder = new javax.swing.JPanel();
        jPanTilfVarer = new javax.swing.JPanel();
        jBtnFjern = new javax.swing.JButton();
        jScrollPane1 = new javax.swing.JScrollPane();
        jListVare = new javax.swing.JList();
        jPanFaktura = new javax.swing.JPanel();
        jRadioEu = new javax.swing.JRadioButton();
        jScrollPane2 = new javax.swing.JScrollPane();
        jTextFaktura = new javax.swing.JTextArea();
        jRadioKr = new javax.swing.JRadioButton();
        jBtnBetal = new javax.swing.JButton();
        jCheckMedlem = new javax.swing.JCheckBox();
        jPanTop = new javax.swing.JPanel();
        jTextVare = new javax.swing.JTextField();
        jTextAntal = new javax.swing.JTextField();
        jBtnAdd = new javax.swing.JButton();
        jLabAntal = new javax.swing.JLabel();
        jKasseFeedback = new javax.swing.JLabel();

        setBackground(new java.awt.Color(186, 153, 108));

        jStartbeholdning.setBackground(java.awt.Color.darkGray);

        jSBLAB.setForeground(new java.awt.Color(250, 250, 250));
        jSBLAB.setText("Indtast startbeholdninger:");

        jSBkr.setBackground(Main.getRED_COLOR());
        jSBkr.setForeground(new java.awt.Color(250, 250, 250));
        jSBkr.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jSBkr.setCaretColor(new java.awt.Color(250, 250, 250));
        jSBkr.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jSBkrActionPerformed(evt);
            }
        });
        jSBkr.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jSBkrKeyReleased(evt);
            }
        });

        jLabKr.setForeground(new java.awt.Color(250, 250, 250));
        jLabKr.setText("kr.");

        jLabeu.setForeground(new java.awt.Color(250, 250, 250));
        jLabeu.setText("€");

        jSBeu.setBackground(Main.getRED_COLOR());
        jSBeu.setForeground(new java.awt.Color(250, 250, 250));
        jSBeu.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jSBeu.setCaretColor(new java.awt.Color(250, 250, 250));
        jSBeu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jSBeuActionPerformed(evt);
            }
        });
        jSBeu.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jSBeuKeyReleased(evt);
            }
        });

        jBtnStartbeholdning.setBackground(new java.awt.Color(218, 191, 137));
        jBtnStartbeholdning.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        jBtnStartbeholdning.setForeground(new java.awt.Color(25, 25, 25));
        jBtnStartbeholdning.setText("OK");
        jBtnStartbeholdning.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBtnStartbeholdning.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnStartbeholdningActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jStartbeholdningLayout = new javax.swing.GroupLayout(jStartbeholdning);
        jStartbeholdning.setLayout(jStartbeholdningLayout);
        jStartbeholdningLayout.setHorizontalGroup(
            jStartbeholdningLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jStartbeholdningLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jSBLAB, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSBkr, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabKr)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jSBeu, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabeu)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jBtnStartbeholdning, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jStartbeholdningLayout.setVerticalGroup(
            jStartbeholdningLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jStartbeholdningLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                .addComponent(jSBkr, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jSBLAB)
                .addComponent(jLabKr)
                .addComponent(jLabeu)
                .addComponent(jSBeu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addComponent(jBtnStartbeholdning))
        );

        jAktuelBeholdning.setBackground(java.awt.Color.darkGray);

        jSBLAB1.setForeground(new java.awt.Color(250, 250, 250));
        jSBLAB1.setText("Kassebeholding:");

        jKr.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        jKr.setForeground(new java.awt.Color(250, 250, 250));
        jKr.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);

        jEu.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        jEu.setForeground(new java.awt.Color(250, 250, 250));
        jEu.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);

        jLabEu.setForeground(new java.awt.Color(250, 250, 250));
        jLabEu.setText("€");

        jBtnKassen.setBackground(new java.awt.Color(218, 191, 137));
        jBtnKassen.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        jBtnKassen.setForeground(new java.awt.Color(25, 25, 25));
        jBtnKassen.setText("Opgør kassen");
        jBtnKassen.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBtnKassen.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnKassenActionPerformed(evt);
            }
        });

        jAktuelEu.setEditable(false);
        jAktuelEu.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        jAktuelEu.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        jLabKr1.setForeground(new java.awt.Color(250, 250, 250));
        jLabKr1.setText("kr.");

        jAktuelKr.setEditable(false);
        jAktuelKr.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        jAktuelKr.setHorizontalAlignment(javax.swing.JTextField.CENTER);

        javax.swing.GroupLayout jAktuelBeholdningLayout = new javax.swing.GroupLayout(jAktuelBeholdning);
        jAktuelBeholdning.setLayout(jAktuelBeholdningLayout);
        jAktuelBeholdningLayout.setHorizontalGroup(
            jAktuelBeholdningLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jAktuelBeholdningLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jSBLAB1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jKr, javax.swing.GroupLayout.PREFERRED_SIZE, 66, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(145, 145, 145)
                .addComponent(jEu, javax.swing.GroupLayout.PREFERRED_SIZE, 62, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jAktuelKr, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabKr1)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jAktuelEu, javax.swing.GroupLayout.PREFERRED_SIZE, 95, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jLabEu)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(jBtnKassen, javax.swing.GroupLayout.PREFERRED_SIZE, 90, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
        jAktuelBeholdningLayout.setVerticalGroup(
            jAktuelBeholdningLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jAktuelKr)
            .addGroup(jAktuelBeholdningLayout.createSequentialGroup()
                .addGroup(jAktuelBeholdningLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jSBLAB1)
                    .addComponent(jKr)
                    .addComponent(jLabEu)
                    .addComponent(jEu)
                    .addComponent(jBtnKassen)
                    .addComponent(jAktuelEu, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                    .addComponent(jLabKr1))
                .addGap(0, 0, Short.MAX_VALUE))
        );

        jPanHolder.setBackground(new java.awt.Color(186, 153, 108));

        jPanTilfVarer.setBackground(new java.awt.Color(186, 153, 108));
        jPanTilfVarer.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(250, 250, 250)), "Tilføjede varer", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Verdana", 0, 11), java.awt.Color.darkGray)); // NOI18N

        jBtnFjern.setBackground(new java.awt.Color(218, 191, 137));
        jBtnFjern.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        jBtnFjern.setForeground(new java.awt.Color(25, 25, 25));
        jBtnFjern.setText("Fjern vare");
        jBtnFjern.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBtnFjern.setFocusPainted(false);
        jBtnFjern.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnFjernActionPerformed(evt);
            }
        });

        jListVare.setBackground(new java.awt.Color(240, 240, 240));
        jListVare.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(250, 250, 250)));
        jListVare.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        jListVare.setForeground(new java.awt.Color(25, 25, 25));
        jScrollPane1.setViewportView(jListVare);

        javax.swing.GroupLayout jPanTilfVarerLayout = new javax.swing.GroupLayout(jPanTilfVarer);
        jPanTilfVarer.setLayout(jPanTilfVarerLayout);
        jPanTilfVarerLayout.setHorizontalGroup(
            jPanTilfVarerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanTilfVarerLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane1, javax.swing.GroupLayout.PREFERRED_SIZE, 234, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jBtnFjern, javax.swing.GroupLayout.PREFERRED_SIZE, 73, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanTilfVarerLayout.setVerticalGroup(
            jPanTilfVarerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanTilfVarerLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanTilfVarerLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane1)
                    .addComponent(jBtnFjern, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
                .addGap(10, 10, 10))
        );

        jPanFaktura.setBackground(new java.awt.Color(186, 153, 108));
        jPanFaktura.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(250, 250, 250)), "Faktura", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Verdana", 0, 11), java.awt.Color.darkGray)); // NOI18N

        jRadioEu.setBackground(new java.awt.Color(186, 153, 108));
        buttonGroup.add(jRadioEu);
        jRadioEu.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        jRadioEu.setForeground(java.awt.Color.darkGray);
        jRadioEu.setText("EU");
        jRadioEu.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioEuActionPerformed(evt);
            }
        });

        jTextFaktura.setEditable(false);
        jTextFaktura.setBackground(new java.awt.Color(240, 240, 240));
        jTextFaktura.setColumns(20);
        jTextFaktura.setFont(new java.awt.Font("Monospaced", 0, 12)); // NOI18N
        jTextFaktura.setForeground(new java.awt.Color(25, 25, 25));
        jTextFaktura.setRows(5);
        jTextFaktura.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(250, 250, 250)));
        jScrollPane2.setViewportView(jTextFaktura);

        jRadioKr.setBackground(new java.awt.Color(186, 153, 108));
        buttonGroup.add(jRadioKr);
        jRadioKr.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        jRadioKr.setForeground(java.awt.Color.darkGray);
        jRadioKr.setSelected(true);
        jRadioKr.setText("KR");
        jRadioKr.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jRadioKrActionPerformed(evt);
            }
        });

        jBtnBetal.setBackground(new java.awt.Color(218, 191, 137));
        jBtnBetal.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        jBtnBetal.setForeground(new java.awt.Color(25, 25, 25));
        jBtnBetal.setText("Betal / Vis bon");
        jBtnBetal.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBtnBetal.setFocusPainted(false);
        jBtnBetal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnBetalActionPerformed(evt);
            }
        });

        jCheckMedlem.setBackground(new java.awt.Color(186, 153, 108));
        jCheckMedlem.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        jCheckMedlem.setForeground(java.awt.Color.darkGray);
        jCheckMedlem.setText("Medlem");
        jCheckMedlem.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jCheckMedlemActionPerformed(evt);
            }
        });

        javax.swing.GroupLayout jPanFakturaLayout = new javax.swing.GroupLayout(jPanFaktura);
        jPanFaktura.setLayout(jPanFakturaLayout);
        jPanFakturaLayout.setHorizontalGroup(
            jPanFakturaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanFakturaLayout.createSequentialGroup()
                .addContainerGap()
                .addGroup(jPanFakturaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jScrollPane2)
                    .addGroup(jPanFakturaLayout.createSequentialGroup()
                        .addGroup(jPanFakturaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                            .addGroup(jPanFakturaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.TRAILING, false)
                                .addComponent(jRadioEu, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jRadioKr, javax.swing.GroupLayout.PREFERRED_SIZE, 49, javax.swing.GroupLayout.PREFERRED_SIZE))
                            .addComponent(jCheckMedlem))
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jBtnBetal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
                .addContainerGap())
        );
        jPanFakturaLayout.setVerticalGroup(
            jPanFakturaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanFakturaLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jScrollPane2, javax.swing.GroupLayout.DEFAULT_SIZE, 165, Short.MAX_VALUE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addGroup(jPanFakturaLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addGroup(jPanFakturaLayout.createSequentialGroup()
                        .addComponent(jRadioKr)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jRadioEu)
                        .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                        .addComponent(jCheckMedlem))
                    .addComponent(jBtnBetal, javax.swing.GroupLayout.PREFERRED_SIZE, 69, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addContainerGap())
        );

        jPanTop.setBackground(new java.awt.Color(186, 153, 108));
        jPanTop.setBorder(javax.swing.BorderFactory.createTitledBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(240, 240, 240)), "Indtast varenummer", javax.swing.border.TitledBorder.DEFAULT_JUSTIFICATION, javax.swing.border.TitledBorder.DEFAULT_POSITION, new java.awt.Font("Verdana", 0, 11), java.awt.Color.darkGray)); // NOI18N

        jTextVare.setBackground(new java.awt.Color(240, 240, 240));
        jTextVare.setFont(new java.awt.Font("Verdana", 0, 18)); // NOI18N
        jTextVare.setForeground(new java.awt.Color(25, 25, 25));
        jTextVare.setText("Indtast venligst en startbeholdning");
        jTextVare.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(250, 250, 250)));
        jTextVare.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jTextVareFocusGained(evt);
            }
        });
        jTextVare.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextVareActionPerformed(evt);
            }
        });
        jTextVare.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextVareKeyReleased(evt);
            }
        });

        jTextAntal.setBackground(new java.awt.Color(240, 240, 240));
        jTextAntal.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        jTextAntal.setForeground(new java.awt.Color(25, 25, 25));
        jTextAntal.setHorizontalAlignment(javax.swing.JTextField.CENTER);
        jTextAntal.setText("1");
        jTextAntal.setBorder(javax.swing.BorderFactory.createLineBorder(new java.awt.Color(250, 250, 250)));
        jTextAntal.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jTextAntalActionPerformed(evt);
            }
        });
        jTextAntal.addFocusListener(new java.awt.event.FocusAdapter() {
            public void focusGained(java.awt.event.FocusEvent evt) {
                jTextAntalFocusGained(evt);
            }
            public void focusLost(java.awt.event.FocusEvent evt) {
                jTextAntalFocusLost(evt);
            }
        });
        jTextAntal.addKeyListener(new java.awt.event.KeyAdapter() {
            public void keyReleased(java.awt.event.KeyEvent evt) {
                jTextAntalKeyReleased(evt);
            }
        });

        jBtnAdd.setBackground(new java.awt.Color(218, 191, 137));
        jBtnAdd.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        jBtnAdd.setForeground(new java.awt.Color(25, 25, 25));
        jBtnAdd.setText("Tilføj");
        jBtnAdd.setBorder(new javax.swing.border.SoftBevelBorder(javax.swing.border.BevelBorder.RAISED));
        jBtnAdd.setFocusPainted(false);
        jBtnAdd.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jBtnAddActionPerformed(evt);
            }
        });

        jLabAntal.setFont(new java.awt.Font("Verdana", 0, 11)); // NOI18N
        jLabAntal.setForeground(java.awt.Color.darkGray);
        jLabAntal.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);
        jLabAntal.setText("Antal:");

        javax.swing.GroupLayout jPanTopLayout = new javax.swing.GroupLayout(jPanTop);
        jPanTop.setLayout(jPanTopLayout);
        jPanTopLayout.setHorizontalGroup(
            jPanTopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanTopLayout.createSequentialGroup()
                .addContainerGap()
                .addComponent(jTextVare)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addGroup(jPanTopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                    .addComponent(jLabAntal, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jTextAntal, javax.swing.GroupLayout.PREFERRED_SIZE, 34, javax.swing.GroupLayout.PREFERRED_SIZE))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jBtnAdd, javax.swing.GroupLayout.PREFERRED_SIZE, 84, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addContainerGap())
        );
        jPanTopLayout.setVerticalGroup(
            jPanTopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanTopLayout.createSequentialGroup()
                .addGap(10, 10, 10)
                .addGroup(jPanTopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jTextVare, javax.swing.GroupLayout.DEFAULT_SIZE, 39, Short.MAX_VALUE)
                    .addGroup(jPanTopLayout.createSequentialGroup()
                        .addGroup(jPanTopLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING, false)
                            .addComponent(jBtnAdd, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanTopLayout.createSequentialGroup()
                                .addComponent(jLabAntal)
                                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                                .addComponent(jTextAntal, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)))
                        .addGap(0, 0, Short.MAX_VALUE)))
                .addContainerGap())
        );

        jKasseFeedback.setFont(new java.awt.Font("Verdana", 1, 11)); // NOI18N
        jKasseFeedback.setForeground(Main.getRED_COLOR());
        jKasseFeedback.setHorizontalAlignment(javax.swing.SwingConstants.CENTER);

        javax.swing.GroupLayout jPanHolderLayout = new javax.swing.GroupLayout(jPanHolder);
        jPanHolder.setLayout(jPanHolderLayout);
        jPanHolderLayout.setHorizontalGroup(
            jPanHolderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanHolderLayout.createSequentialGroup()
                .addComponent(jPanTilfVarer, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED)
                .addComponent(jPanFaktura, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE))
            .addComponent(jPanTop, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jKasseFeedback, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        jPanHolderLayout.setVerticalGroup(
            jPanHolderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanHolderLayout.createSequentialGroup()
                .addComponent(jPanTop, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(8, 8, 8)
                .addComponent(jKasseFeedback, javax.swing.GroupLayout.PREFERRED_SIZE, 15, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(8, 8, 8)
                .addGroup(jPanHolderLayout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
                    .addComponent(jPanTilfVarer, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                    .addComponent(jPanFaktura, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)))
        );

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(this);
        this.setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jStartbeholdning, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jAktuelBeholdning, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addComponent(jPanHolder, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addComponent(jPanHolder, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
                .addGap(0, 0, 0)
                .addComponent(jAktuelBeholdning, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(0, 0, 0)
                .addComponent(jStartbeholdning, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE))
        );
    }// </editor-fold>//GEN-END:initComponents

    private void jBtnStartbeholdningActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnStartbeholdningActionPerformed
        validateKasseInput();
    }//GEN-LAST:event_jBtnStartbeholdningActionPerformed

    public void validateKasseInput() {
        if (jSBkr.getBackground() != Main.getRED_COLOR() && jSBeu.getBackground() != Main.getRED_COLOR()) {
            setStartBeholdning();
        }
    }

    private void jBtnKassenActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnKassenActionPerformed

        double difIKR = kh.getKasse().getAktuelKr() - kh.getKasse().getStartKr();
        double difIEU = kh.getKasse().getAktuelEu() - kh.getKasse().getStartEu();

        Kasserapport kasserapport = new Kasserapport(this);
        kasserapport.setVisible(true);
    }//GEN-LAST:event_jBtnKassenActionPerformed

    public void updateOptaltKasse(double optaltKr, double optaltEu) {
        kh.getKasse().setOptaltKr(optaltKr);
        kh.getKasse().setOptaltEu(optaltEu);
        kh.updateOptaltKasse(optaltKr, optaltEu);
    }

    public void closeKasse() {
        kh.closeKasse();
        kh.saveKasseToDB();
        kh.createKasseRapport();
        jAktuelBeholdning.setVisible(false);
        skrivebeskyttet(true);
        skrivebeskyttetBetal(true);
    }

    private void jBtnAddActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnAddActionPerformed
        GUI.getGuiHandler().setFeedbackMessage("", Main.getRED_COLOR());
        addVare();
    }//GEN-LAST:event_jBtnAddActionPerformed

    // Nedenstående skal bruges når der skal betales, hvorefter betalingstypen skal sættes.
    public int getRadioButtonSelection() {
        int radioSelection = 0;
        if (jRadioKr.isSelected()) {
            radioSelection = 1;
        }
        if (jRadioEu.isSelected()) {
            radioSelection = 2;
        }
        return radioSelection;
    }

    public void showInvoice() {
        jTextFaktura.setText(FakturaHandler.faktura + "");
        jTextFaktura.setCaretPosition(0);
        jTextAntal.setText("1");
        jTextVare.requestFocus();
        jTextVare.selectAll();
    }

    private void jBtnFjernActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnFjernActionPerformed
        if (jListVare.getSelectedIndex() > -1) {
            int lineNumber = jListVare.getSelectedIndex();
            jTextVare.setText(fvh.getVareNr(lineNumber) + "");
            GUI.getGuiHandler().setFeedbackMessage("Fjernet varenummer: " + fvh.getVareNr(lineNumber) + " fra faktura", Main.getGREEN_COLOR());
            fvh.removeFromInvoice(lineNumber);
            showInvoice();
        }
    }//GEN-LAST:event_jBtnFjernActionPerformed

    private void jBtnBetalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jBtnBetalActionPerformed
        if (!listModel.isEmpty()) {
            long dato = System.currentTimeMillis() / 1000L;
            fh.setDato(dato);
            fh.setBetalingsType(getRadioButtonSelection());
            fh.saveInvoiceToDB();
            if (Main.getDbConnection().isDbSucces()) {
                kh.updateKasse(TextRegler.roundDouble(fh.faktura.getTotalInvoice()), fh.faktura.getBetalingsType());
                try {
                    if (fh.faktura.getFakturaNr() != Main.getDbConnection().getNextInvoiceNumber()) {
                        GUI.getGuiHandler().showPrint(fh.faktura.getFakturaNr());
                        fh.saveInvoiceToText();
                        setAktuelKasse();
                        firstTime = true;
                    }
                } catch (SQLException ex) {
                    GUI.getGuiHandler().setFeedbackMessage("");
                } catch (NullPointerException ex) {
                    GUI.getGuiHandler().setFeedbackMessage("");
                }
                clearKasse();
            }
        } else {
            GUI.getGuiHandler().setFeedbackMessage("Du har ikke tilføjet nogle varer.", Main.getRED_COLOR());
        }
    }//GEN-LAST:event_jBtnBetalActionPerformed

    public void clearKasse() {
        fvh.createFaktureretVareListe();
        jTextAntal.setText("1");
        jTextVare.setText("");
        fvh.clearList();
        jTextFaktura.setText("");
        jCheckMedlem.setSelected(false);
        skrivebeskyttetBetal(true);
        firstTime = true;
    }

    public void clearFeedback() {
        jKasseFeedback.setText("");
    }

    private void jRadioKrActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioKrActionPerformed
        fh.setBetalingsType(getRadioButtonSelection());
        showInvoice();
    }//GEN-LAST:event_jRadioKrActionPerformed

    private void jRadioEuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioEuActionPerformed
        fh.setBetalingsType(getRadioButtonSelection());
        showInvoice();
    }//GEN-LAST:event_jRadioEuActionPerformed

    private void jRadioKortActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jRadioKortActionPerformed
    }//GEN-LAST:event_jRadioKortActionPerformed

    private void jSBkrKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jSBkrKeyReleased
        startBeholdningDouble(jSBkr);
    }//GEN-LAST:event_jSBkrKeyReleased

    private void jSBeuKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jSBeuKeyReleased
        startBeholdningDouble(jSBeu);
    }//GEN-LAST:event_jSBeuKeyReleased

    private void jTextAntalFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextAntalFocusGained
        jTextAntal.selectAll();
    }//GEN-LAST:event_jTextAntalFocusGained

    private void jTextAntalFocusLost(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextAntalFocusLost
        boolean notInt = false;
        try {
            Integer.parseInt(jTextAntal.getText());
        } catch (NumberFormatException ex) {
            notInt = true;
        }
        if (jTextAntal.getText().equals("") || notInt) {
            jTextAntal.setText("1");
        }
    }//GEN-LAST:event_jTextAntalFocusLost

    private void jTextVareActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextVareActionPerformed
        addVare();
    }//GEN-LAST:event_jTextVareActionPerformed

    private void jCheckMedlemActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jCheckMedlemActionPerformed
        if (jCheckMedlem.isSelected()) {
            fh.setMedlem(true);
        } else {
            fh.setMedlem(false);
        }
        showInvoice();
    }//GEN-LAST:event_jCheckMedlemActionPerformed

    private void jTextVareKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextVareKeyReleased
        TextRegler.onlyDig(jTextVare);
    }//GEN-LAST:event_jTextVareKeyReleased

    private void jTextAntalKeyReleased(java.awt.event.KeyEvent evt) {//GEN-FIRST:event_jTextAntalKeyReleased
        TextRegler.onlyDig(jTextAntal);
    }//GEN-LAST:event_jTextAntalKeyReleased

    private void jTextVareFocusGained(java.awt.event.FocusEvent evt) {//GEN-FIRST:event_jTextVareFocusGained
        jTextVare.selectAll();
    }//GEN-LAST:event_jTextVareFocusGained

    private void jTextAntalActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jTextAntalActionPerformed
        addVare();
    }//GEN-LAST:event_jTextAntalActionPerformed

    private void jSBkrActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jSBkrActionPerformed
        validateKasseInput();
    }//GEN-LAST:event_jSBkrActionPerformed

    private void jSBeuActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_jSBeuActionPerformed
        validateKasseInput();
    }//GEN-LAST:event_jSBeuActionPerformed


    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.ButtonGroup buttonGroup;
    private javax.swing.JPanel jAktuelBeholdning;
    private javax.swing.JTextField jAktuelEu;
    private javax.swing.JTextField jAktuelKr;
    private javax.swing.JButton jBtnAdd;
    private javax.swing.JButton jBtnBetal;
    private javax.swing.JButton jBtnFjern;
    private javax.swing.JButton jBtnKassen;
    private javax.swing.JButton jBtnStartbeholdning;
    private javax.swing.JCheckBox jCheckMedlem;
    private javax.swing.JLabel jEu;
    private javax.swing.JLabel jKasseFeedback;
    private javax.swing.JLabel jKr;
    private javax.swing.JLabel jLabAntal;
    private javax.swing.JLabel jLabEu;
    private javax.swing.JLabel jLabKr;
    private javax.swing.JLabel jLabKr1;
    private javax.swing.JLabel jLabeu;
    private javax.swing.JList jListVare;
    private javax.swing.JPanel jPanFaktura;
    private javax.swing.JPanel jPanHolder;
    private javax.swing.JPanel jPanTilfVarer;
    private javax.swing.JPanel jPanTop;
    private javax.swing.JRadioButton jRadioEu;
    private javax.swing.JRadioButton jRadioKr;
    private javax.swing.JLabel jSBLAB;
    private javax.swing.JLabel jSBLAB1;
    private javax.swing.JTextField jSBeu;
    private javax.swing.JTextField jSBkr;
    private javax.swing.JScrollPane jScrollPane1;
    private javax.swing.JScrollPane jScrollPane2;
    private javax.swing.JPanel jStartbeholdning;
    private javax.swing.JTextField jTextAntal;
    private javax.swing.JTextArea jTextFaktura;
    private javax.swing.JTextField jTextVare;
    // End of variables declaration//GEN-END:variables
}
